﻿@model CREAPA.Dominio.FuncionarioPermissao


@{
    ViewBag.Title = "Lista Permissoes";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<style type="text/css">
.table{
    border : 1px solid #809FFF;
    background-color: white;
    
    border-collapse: collapse; 
    border: 1px solid black; 
}

.header{
    background-color: #111839;
    color: white;
}

.header a{
    color: white;
    text-decoration: none;
}

.footer{
    background-color:#111839;
    color: white;
}

.alternate{
    background-color: #b7c3f6;
}
</style>
@{    
    var gridPermissao = new WebGrid(ViewBag.listaFuncionarioPermissao, canPage: true, rowsPerPage: 100); 
}

@{    
    var gridPermissaoDisponivel = new WebGrid(ViewBag.listaFuncionarioPermissaoDisponivel, canPage: true, rowsPerPage: 100 ); 
}


@using (Html.BeginForm("Excluir","FuncionarioPermissao")) {
    @Html.AntiForgeryToken()
   

@Html.HiddenFor(model => model.Login)

@Html.ValidationSummary(true)
<h2>Lista de Permissões Do Usuario</h2>

    @gridPermissao.GetHtml( tableStyle: "table",
        alternatingRowStyle: "alternate",
        headerStyle: "header",
        footerStyle: "footer",
        mode: WebGridPagerModes.FirstLast | WebGridPagerModes.NextPrevious,
        firstText: "Primeiro",
        previousText: "Anterior",
        nextText: "Próximo",
        lastText: "Último",columns: gridPermissao.Columns(
            gridPermissao.Column("Id", header:"Permissão", format: @<text><center>@item.Id</center></text>),                 
            gridPermissao.Column("Permissao", header:"Descricao da Permissão", format: @<text>@item.Permissao</text>),
            gridPermissao.Column(header: "Excluir",   format: @<text><center><input name="Excluir" type="checkbox" value="@item.Id"/></center></text>)
           )
)          
        <p> 
        <input type="submit" value="Excluir" class="button"/>
        </p>
}
@using (Html.BeginForm("Adicionar","FuncionarioPermissao")) {
    @Html.AntiForgeryToken()
<h2>Lista de Permissões Disponiveis Para o Usuario</h2>

@gridPermissaoDisponivel.GetHtml( tableStyle: "table",
        alternatingRowStyle: "alternate",
        headerStyle: "header",
        footerStyle: "footer",
        mode: WebGridPagerModes.FirstLast | WebGridPagerModes.NextPrevious,
        firstText: "Primeiro",
        previousText: "Anterior",
        nextText: "Próximo",
        lastText: "Último",columns: gridPermissaoDisponivel.Columns(
            gridPermissaoDisponivel.Column("Id", header:"Permissão", format: @<text><center>@item.Id</center></text>),                 
            gridPermissaoDisponivel.Column("Permissao", header:"Descricao da Permissão", format: @<text>@item.Permissao</text>),
            gridPermissaoDisponivel.Column(header:"Adicionar", format: @<text><center><input name="Selecionar" type="checkbox" value="@item.Id"/></center></text>)
        )
)
          <p>
            <input type="submit" value="Adicionar" class="button"/>
            @Html.ActionLink("Voltar", "Alterar","Funcionario", new {login = ViewBag.Login},new { @class = "button2"})
      </p>
}   